package com.yanqu.road.server.channelserver.cmd.activity.tonbing;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.ChannelTonBingProto;
import com.yanqu.road.server.channelserver.manager.activity.tonbing.ChannelTonBingMgr;
import com.yanqu.road.server.channelserver.manager.activity.tonbing.activity.ChannelTonBingActivity;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.command.Command;
import com.yanqu.road.server.protocol.ChannelProtocol;
import io.netty.channel.ChannelHandlerContext;

@Cmd(code = ChannelProtocol.N_TON_BING_NOTIFY_UNION_MEMBER_CHANGE_REQ, desc = "")
public class ChannelTonBingNotifyUnionMemberChangeReqCmd implements Command {

    @Override
    public void execute(ChannelHandlerContext ctx, YanQuMessage packet) throws Exception {
        ChannelTonBingProto.ChannelTonBingNotifyUnionMemberChangeReqMsg reqMsg = ChannelTonBingProto.ChannelTonBingNotifyUnionMemberChangeReqMsg.parseFrom(packet.getBytes());
        ChannelTonBingActivity activity = ChannelTonBingMgr.getActivity(reqMsg.getActivityId());
        //todo 成员名单锁定,商会只更新职位,商会名字,旗帜之类的基础数据
        activity.notifyUnionMemberChangeByCmd(reqMsg.getUnionUid());
    }
}
